#!/bin/bash
# SPDX-License-Identifier: MulanPSL-2.0+
# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.

# fix files permissions cause container service start failed
umask 002

initialize_repo()
{
	local repo="$1"

	[ -d "/c/$repo/.git" ] || {
		git clone https://gitee.com/wu_fengguang/"$repo".git /c/"$repo" || \
			 git clone http://gitee.com/wu_fengguang/"$repo".git /c/"$repo"
		chmod -R +r /c/"$repo"
	}

	cd /c/"$repo"
	git config --global --add safe.directory /c/"$repo"
}

initialize_repo lkp-tests
